package cn.wolfcode.domain;

import lombok.*;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

@Getter
@Setter
@ToString
@AllArgsConstructor
@NoArgsConstructor
public class City {
    private Long id;
    private String name;

    public static List<City> getCityByProvinceId(Long pid) {
        List<City> cities = new ArrayList<>();
        if (pid == 1) {
            cities = Arrays.asList(
                    new City(11L, "呼和浩特"),
                    new City(12L, "鄂尔多斯"),
                    new City(13L,"乌兰察布")
            );
        } else if (pid == 2) {
            cities = Arrays.asList(
                    new City(21L,"沈阳"),
                    new City(22L,"大连"),
                    new City(23L,"鞍山")
            );
        }else if(pid == 3){
            cities = Arrays.asList(
                    new City(31L,"西安"),
                    new City(32L,"延安"),
                    new City(33L,"咸阳")
            );
        }
        return cities;
    }
}
